'''
Python enum 枚举
判断 key(键) 或者 value(值)是否在枚举中
'''
from enum import Enum,IntEnum
class Address_id(IntEnum):
    HOST_ID: int = 0x0
    NAV_ID: int = 0x5
    SLAM_LASER_ID: int = 0x18
    SLAM_VISION_ID: int = 0x19

a=0x18

if "HOST_ID" in Address_id.__members__:
    print("key 键值 HOST_ID 存在于Address_id")
if a in Address_id._value2member_map_:
    print("value 0x18 存在于Address_id")

'''
key 键值 HOST_ID 存在于Address_id
value 0x18 存在于Address_id
'''